
/*
 * This class creates a "clean" JTable, with the needed columns, spaced out within the GuiMainFrame. 
 *  
*/
package UiLayer;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.TableColumnModel;
import javax.swing.table.TableModel;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class CleanTable {
	
	// Construct a new, fresh and CLEAN table
	//
    public CleanTable() 
    {    
        TableColumnModel columnNames;
		TableModel itemData;
		
		final JTable table = new JTable(itemData, columnNames);
 
        // Column names for the ONLY table used for displaying any objects are set in the String object below.
        // Many more may be added...
        
        // NOTE NOTE:    MUST be set() by the objects that are to be displayed - correction muSt follow before handing in this assignment.
        // DELETE THE ABOVE COMMENTS, when everything is done and the final version has been submitted via SVN... All of the groups members MUST concur on the completion of the item-software.
        
        String[] columnNames1 = {"Nr.",
                                "Vare",
                                "Beskrivelse",
                                "EAN",
                                "Pris (ex moms)",
                                ""};
 
        // Item objects (from the store) are stored in the object below, of the type 
        
        Object[][] itemData = {
        
        		// 
        		
        		
        {"Kathy", "Smith", "Snowboarding", new Integer(5), new Boolean(false)},
        {"John", "Doe", "Rowing", new Integer(3), new Boolean(true)},
        {"Sue", "Black", "Knitting", new Integer(2), new Boolean(false)},
        {"Jane", "White", "Speed reading", new Integer(20), new Boolean(true)},
        {"Joe", "Brown", "Pool", new Integer(10), new Boolean(false)}
        
        };
 
        table.setPreferredScrollableViewportSize(new Dimension(500, 70));
        table.setFillsViewportHeight(true);
        
    }
    
}
